<include file="public@header"/>
<style type="text/css">
    .pic-list li {
        margin-bottom: 5px;
    }
</style>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li><a href="{:url('TechAdmin/index')}">老师信息列表</a></li>
        <li class="active"><a href="#">设置老师课时费用</a></li>
    </ul>
    <form action="{:url('TechAdmin/setprice')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
        <input type="text" value="{$teachers.id}" class="form-control" name="id" style="display:none" placeholder="请填写花卉的标题" >
        <div class="row">
            <div class="col-md-9">
                <table class="table table-bordered">
                    <tr>
                        <th style="text-align: center">老师的姓名：</th>
                        <td>
                            {$teachers.xingming}
                        </td>
                    </tr>
                    <tr>
                        <th style="text-align: center">老师的课时费用</th>
                        <td>
                            每小时<input type="text" value="{$teachers.price}" class="form-control" name="price"  placeholder="价格" >元
                        </td>
                    </tr>
                    <tr>
                        <th style="text-align: center">头像图片（375*61）</th>
                        <td>
                            <div>
                                <input type="hidden" name="headimg[thumbnail]" class="form-control"
                                       id="js-thumbnail-input4" value="{$headimg2}">
                                <div>
                                    <a href="javascript:uploadOneImage('图片上传','#js-thumbnail-input4');">
                                        <img src="{$headimg}"
                                             id="js-thumbnail-input4-preview"
                                             width="135" style="cursor: pointer"/>
                                    </a>
                                    <input type="button" class="btn btn-sm btn-cancel-thumbnail4"
                                           onclick="$('#thumbnail-preview4').attr('src','__TMPL__/public/assets/images/default-thumbnail.png');$('#thumbnail').val('');return false;"
                                           value="取消图片">
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <th style="text-align: center">用户名：</th>
                        <td>
                            <input type="text"  class="form-control" name="username"  placeholder="填入用户名" value="{$teachers.username}">
                        </td>
                    </tr>
                    <tr>
                        <th style="text-align: center">密码:</th>
                        <td>
                            <input type="password" value="" class="form-control" name="password"  placeholder="密码" >
                        </td>
                    </tr>
                    <tr>
                        <th style="text-align: center">对老师的评价：</th>
                        <td>
                            <input type="text" value="" class="form-control" name="pinglun"  placeholder="请填写评论内容" >
                        </td>
                    </tr>
                </table>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('ADD')}</button>
                        <a class="btn btn-default" href="{:url('TechAdmin/index')}">{:lang('BACK')}</a>
                    </div>
                </div>
            </div>

        </div>
    </form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
    //编辑器路径定义
    var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
    $(function () {
        editorcontent = new baidu.editor.ui.Editor();
        editorcontent.render('content');
        editorcontent2 = new baidu.editor.ui.Editor();
        editorcontent2.render('content2');
        try {
            editorcontent.sync();
            editorcontent2.sync();
        } catch (err) {
        }

        //$('#more-template-select').val('page');
    });
</script>
<script>
    $('.btn-cancel-thumbnail4').click(function () {
        $('#js-thumbnail-input4-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
        $('#js-thumbnail-input4').val('');
    });
    //=================上传图片===========================
    function uploadImages(){
        var len = $('#photos li').length;
        if(len>=4){
            alert('最多只能上传4张图片！');
        }else{
            uploadMultiImage('图片上传','#photos','photos-item-tpl');
        }
    }

    $(function(){
        $('.btn-cancel-thumbnail').click(function () {
            $('#js-thumbnail-input-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
            $('#js-thumbnail-input').val('');
        });

        $('.btn-cancel-thumbnail2').click(function () {
            $('#js-thumbnail-input-preview2').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
            $('#js-thumbnail-input2').html('');
        });
    });

</script>
<script type="text/html" id="photos-item-tpl">
    <li id="saved-image{id}">
        <input id="photo-{id}" type="hidden" name="imgs[]" value="{filepath}">
        <input class="form-control" id="photo-{id}-name" type="text" name="photo_names[]" value="{name}"
               style="width: 200px;" title="图片名称">
        <img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;"
             onclick="imagePreviewDialog(this.src);">
        <a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a>
        <a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>
    </li>
</script>
</body>
</html>